<template>
	<view class="page">
		<Header :title="'添加礼品卡'"></Header>
		<view class="main">
			<image class="cardPic" src="http://maofengshuzinongye.oss-cn-chengdu.aliyuncs.com/2023/12/26/4754a0e4fdaf471cb20938eb62d45b09.png" mode="aspectFill"></image>
			<view class="form">
				<view class="inputItem">
					<view class="label">
						卡号
					</view>
					<u--input v-model="formdata.cardNumber" border="none" placeholder="请输入卡券卡号" clearable></u--input>
				</view>
				<view class="inputItem">
					<view class="label">
						密码
					</view>
					<u--input type="password" v-model="formdata.password" border="none" placeholder="请输入卡券密码" clearable></u--input>
				</view>
			</view>
			<view class="text">
				绑卡说明: <br>
				*输入请注意:没有字母E、1、L、0，同时注意C、D与0的区别，注意区分8与B的区别。 <br>
				*请输入手中纸质卡券的卡弓<br>
				*输入请注意:没有字母E、1、L、0，同时注意C、D与0的区别，注意区分8与B的区别。 <br>
				*请输入手中纸质卡券的卡弓<br>
			</view>
		</view>
		<view class="submitBtn" @click="confirm">
			绑定卡券
		</view>
	</view>
</template>

<script>
	import Header from '@/components/header/header.vue'
	export default {
		components: {
			Header
		},
		data() {
			return {
				formdata: {
					cardNumber: '',
					password: ''
				},
			}
		},
		created() {

		},

		methods: {
			//新增礼品卡
			async confirm() {
				let that = this
				let res = await this.$api.request('manage/card/client/save', 'post', this.formdata)
				if (res.code == 200) {
					uni.showToast({
						title: '添加成功',
						icon: 'none'
					})
					setTimeout(() => {
						that.show = false
					}, 1000)
			
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.submitBtn {
		width: 664rpx;
		height: 80rpx;
		background: #E8220F;
		border-radius: 40rpx;
		font-size: 34rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		text-align: center;
		line-height: 80rpx;
		margin: 0 auto 30rpx;
	}

	.page {
		height: 100vh;
		width: 100vw;
		background-color: #fff;
		overflow: scroll;
	}

	.main {
		padding: 20rpx 20rpx 150rpx;
		width: 100%;
		box-sizing: border-box;

		.cardPic {
			width: 710rpx;
			height: 391rpx;
			margin: 0 auto 55rpx;
		}

		.text {
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #DD3B26;
		}

		.form {

			.inputItem {
				width: 698rpx;
				height: 99rpx;
				background: #F5F5F5;
				border-radius: 10rpx;
				display: flex;
				align-items: center;
				padding: 0 27rpx;
				box-sizing: border-box;
				margin-bottom: 38rpx;

				&:nth-last-child(1) {
					margin-bottom: 51rpx;
				}

				.label {
					font-size: 30rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #333333;
					margin-right: 43rpx;
				}
			}
		}
	}
</style>